# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
pkgname=numactl
pkgver=2.0.16
pkgrel=4
pkgdesc="Simple NUMA policy support"
url="https://github.com/numactl/numactl"
arch="all"
license="LGPL-2.1-only"
makedepends="linux-headers"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="$pkgname-$pkgver-2.tar.gz::https://github.com/numactl/numactl/releases/download/v$pkgver/numactl-$pkgver.tar.gz
	lfs64.patch
	"

case "$CARCH" in
x86)
	# test-distance fails
	options="$options !check"
	;;
esac

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

check() {
	make check VERBOSE=1 TESTS='test/distance test/nodemap test/tbitmap'
}

package() {
	make DESTDIR="$pkgdir" install

	# provided by linux man-pages
	rm -r "$pkgdir"/usr/share/man/man2
}

tools() {
	pkgdesc="NUMA policy control tools"
	license="GPL-2.0-only"

	amove usr/bin
}

sha512sums="
6e17724567c363a08994fe7f5569b6ec62bd1ae608244945fddcb2d6a212b08140340f0d862595ba4016fcba95193e851cb286798f685d314b4c72687af6d879  numactl-2.0.16-2.tar.gz
7a33f72496e49bacbd71962bdd091ae9c73b74bc0dff240791da680a98b8145091a5d3b0460caadd8fff3f6edcf151ea2419473e1aca5838f7fbef11a61c9e55  lfs64.patch
"
